package main

import "fmt"

func main() {
	dp := []int{1, 2, 3, 4, 5, 6, 7}
	rotate(dp, 3)
	fmt.Println(dp)
}

func rotate(nums []int, k int) {
  newNums := make([]int, len(nums))
  for i, v := range nums {
    newNums[(i+k)%len(nums)] = v
  }
  copy(nums, newNums)
}
